﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using VeMayBayBUS;
using VeMayBayDTO;
namespace QLVMBProject
{
    public partial class frmLogin : Form
    {
        public frmLogin()
        {
            InitializeComponent();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            try
            {
                UserDTO use = new UserDTO();
                use.UserName = txtUser.Text;
                use.Pass = txtPass.Text;
                if (UserBUS.GetUse(use))
                {
                  
                    frmMain frm = new frmMain();
                    frm.Show();
                    this.Hide();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                throw;
            }
            
        }

        private void btnCancle_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}
